/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

/**
 *
 * @author Gatoper
 */
@Entity
public class Medicalrecord implements Serializable {

    public Medicalrecord(Pet pet, Long id) {
        this.pet = pet;
        this.id = id;
    }
    
   //@OneToOne(mappedBy= "medicalrecord") 
   private Pet pet;
    @Id
    private Long id;

    public Pet getPet() {
        return pet;
    }

    public void setPet(Pet pet) {
        this.pet = pet;
    }

    public List<Appointment> getAppointment() {
        return appointment;
    }

    public void setAppointment(List<Appointment> appointment) {
        this.appointment = appointment;
    }

    public List<Vacine> getVacine() {
        return vacine;
    }

    public void setVacine(List<Vacine> vacine) {
        this.vacine = vacine;
    }
   @OneToMany(cascade= CascadeType.PERSIST)
   private List<Appointment> appointment=new ArrayList<>();
   @OneToMany(cascade= CascadeType.PERSIST)
    private List<Vacine> vacine=new ArrayList<>();
   
    public Medicalrecord() {
        super();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

   
}
